﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using SymWorld.Model;

namespace SymWorld.Renderer
{
    public partial class WorldStatePanel : UserControl
    {
        private WorldStateRenderer _worldStateRenderer;

        public WorldStatePanel()
        {
            InitializeComponent();
        }

        public WorldStatePanel(WorldState worldState)
        {
            _worldStateRenderer = new WorldStateRenderer(worldState);
        }

        public WorldStateRenderer WorldStateRenderer
        {
            get { return _worldStateRenderer; }
            set { _worldStateRenderer = value; }
        }

        private void WorldStatePanel_Paint(object sender, PaintEventArgs e)
        {
            if (_worldStateRenderer == null)
                return;
            _worldStateRenderer.Render(e.Graphics);
        }
    }
}
